package com.why.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.why.entity.Select;
import com.why.service.ISelectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hy-woo
 * @since 2022-05-30
 */
@RestController
@RequestMapping("/select")
public class SelectController {

    @Autowired
    ISelectService selectService;

    @RequestMapping("/list2")
    public List<Select> list2(){
        QueryWrapper<Select> wrapper = new QueryWrapper<>();
        wrapper.eq("type",2);
        List<Select> list = selectService.list(wrapper);
        return list;
    }

    @RequestMapping("/list")
    public List<Select> list(){
        QueryWrapper<Select> wrapper = new QueryWrapper<>();
        wrapper.eq("type",1);
        List<Select> list = selectService.list(wrapper);
        return list;
    }

}
